/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package e.z.blog.back.bean.base;

import java.util.List;
import java.util.Map;
import org.nutz.dao.entity.annotation.*;

/**
 *
 * @author EnzoZhong
 */
@Table( "t_s_blog_bean_tag" )
public class Tag {

        @Id
        @Column
        @Comment( "序列号" )
        private Integer tagId;
        @Name
        @Column
        @Comment( "标签名" )
        private String tagName;
        @Column
        @Comment( "翻译" )
        @ColDefine( type = ColType.TEXT )
        private Map<String , String> translate;
        @Column
        @Comment( "状态" )
        private Integer state;
        @ManyMany( target = Tag.class , relation = "t_s_blog_bean_essay_tag" , from = "tagId" , to = "essayId" )
        private List<Tag> tagList;

        public Tag () {
        }

        public Integer getState () {
                return state;
        }

        public void setState ( Integer state ) {
                this.state = state;
        }

        public Integer getTagId () {
                return tagId;
        }

        public void setTagId ( Integer tagId ) {
                this.tagId = tagId;
        }

        public List<Tag> getTagList () {
                return tagList;
        }

        public void setTagList ( List<Tag> tagList ) {
                this.tagList = tagList;
        }

        public String getTagName () {
                return tagName;
        }

        public void setTagName ( String tagName ) {
                this.tagName = tagName;
        }

        public Map<String , String> getTranslate () {
                return translate;
        }

        public void setTranslate ( Map<String , String> translate ) {
                this.translate = translate;
        }

        @Override
        public boolean equals ( Object obj ) {
                if ( obj == null ) {
                        return false;
                }
                if ( getClass() != obj.getClass() ) {
                        return false;
                }
                final Tag other = ( Tag ) obj;
                if ( ( this.tagName == null ) ? ( other.tagName != null ) : !this.tagName.equals( other.tagName ) ) {
                        return false;
                }
                return true;
        }

        @Override
        public int hashCode () {
                int hash = 7;
                hash = 89 * hash + ( this.tagName != null ? this.tagName.hashCode() : 0 );
                return hash;
        }

        @Override
        public String toString () {
                return "Tag{" + "tagId=" + tagId + ", tagName=" + tagName + ", translate=" + translate + ", state=" + state + ", tagList=" + tagList + '}';
        }
}
